This is Info file ../info/viper, produced by Makeinfo-1.63 from the input file viper.texi. Distribution ************ Copyright (C) 1995, 1996 Free Software Foundation, Inc. Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the same conditions as for modified versions. File: viper, Node: Display, Next: File and Buffer Handling, Prev: Text Handling, Up: Commands Display ======= `C-g' At user level 1, give file name, status, current line number and relative position. At user levels 2 and higher, abort the current command. `C-c g' Give file name, status, current line number and relative position - all user levels. `C-l' Refresh the screen. ` C-e' Expose more lines at bottom, cursor stays put (if possible). ` C-y' Expose more lines at top, cursor stays put (if possible). ` C-d' Scroll lines downward (default the number of the previous scroll; initialization: half a page). ` C-u' Scroll lines upward (default the number of the previous scroll; initialization: half a page). ` C-f' pages forward. ` C-b' pages backward (in older versions `C-b' only works without count). ` z' Put line at the top of the window (default the current line). ` z-' Put line at the bottom of the window (default the current line). ` z.' Put line in the center of the window (default the current line). File: viper, Node: File and Buffer Handling, Next: Mapping, Prev: Display, Up: Commands File and Buffer Handling ======================== In all file handling commands, space should be typed before entering the file name. If you need to type a modifier, such as `>>' or `!', don't put any space between the command and the modifier. Quit buffer except if modified. `:q!' Quit buffer without checking. In Viper, these two commands are identical. Confirmation is required if exiting modified buffers that visit files. `:susp' `:stop' Suspend Viper `:[x,y] w' Write the file. Viper nakes sure that a final newline is always added to any file where this newline is missing. This is done by setting Emacs variable `require-final-newline' to `t'. If you don't like this feature, use `setq-default' to set `require-final-newline' to `nil'. This must be done either in `.vip' file or in `.emacs' after Viper is loaded. `:[x,y] w ' Write to the file . `:[x,y] w>> ' Append the buffer to the file . There should be no space between `w' and `>>'. Type space after the `>>' and see what happens. `:w! ' Overwrite the file . In Viper, `:w' and `:w!' are identical. Confirmation is required for writing to an existing file (if this is not the file the buffer is visiting) or to a read-only file. `:x,y w ' Write lines x through y to the file . `:wq' Write the file and kill buffer. `:r [ ...]' Read file into a buffer, inserting its contents after the current line. `:xit' Same as `:wq'. Save unsaved buffers, asking for confirmation. `:WW' Like `W', but without asking for confirmation. Save current buffer and kill it. If user level is 1, then save all files and kill Emacs. Killing Emacs is the wrong way to use it, so you should switch to higher user levels as soon as possible. `:x []' Save and kill buffer. `:x! []' `:w![]' and `:q'. `:pre' Preserve the file - autosave buffers. `:rec' Recover file from autosave. Print file name and lines. `:cd []' Set the working directory to (default home directory). `:pwd' Print present working directory. `:e [+] ' Edit files. If no filename is given, edit the file visited by the current buffer. If buffer was modified or the file changed on disk, ask for confirmation. Unlike Vi, Viper allows `:e' to take multiple arguments. The first file is edited the same way as in Vi. The rest are visited in the usual Emacs way. `:e! [+] ' Re-edit file. If no filename, reedit current file. In Viper, unlike Vi, `e!' is identical to `:e'. In both cases, the user is asked to confirm if there is a danger of discarding changes to a buffer. `:q!' Quit Vi without writing. `C-^' Edit the alternate (normally the previous) file. `:rew' Obsolete `:args' List files not shown anywhere with counts for next `:n [count] [+] []' Edit file, or edit files. The count comes from :args. `:N [count] [+] []' Like `:n', but the meaning of the variable EX-CYCLE-OTHER-WINDOW is reversed. Switch to another buffer. If EX-CYCLE-OTHER-WINDOW is `t', switch in another window. Buffer completion is supported. Like `:b', but the meaning of EX-CYCLE-OTHER-WINDOW is reversed. `:
r ' Read the file into the buffer after the line
. `v, V, C-v' Edit a file in current or another window, or in another frame. File name is typed in Minibuffer. File completion and history are supported. File: viper, Node: Mapping, Next: Shell Commands, Prev: File and Buffer Handling, Up: Commands Mapping ======= `:map ' Start defining a Vi-style keyboard macro. For instance, typing `:map www' followed by `:!wc %' and then typing `C-x )' will cause `www' to run wc on current file (Vi replaces `%' with the current file name). `C-x )' Finish defining a keyboard macro. In Viper, this command completes the process of defining all keyboard macros, whether they are Emacs-style or Vi-style. This is a departure from Vi, needed to allow WYSIWYG mapping of keyboard macros and to permit the use of function keys and arbitrary Emacs functions in the macros. `:unmap ' Deprive of its mappings in Vi state. `:map! ' Map a macro for Insert state. `:unmap! ' Deprive of its mapping in Insert state (see `:unmap'). `@' In Vi state, execute the contents of register as a command. In Vi state, repeat last register command. In Vi state, begin keyboard macro. End with @. This will put the macro in the proper register. Register will be automatically downcased. *Note Macros and Registers::, for more info. `@!' In Vi state, yank anonymous macro to register In Vi state, execute anonymous macro (defined by C-x( and C-x )). `C-x e' Like `*', but works in all Viper states. `#g' Execute the last keyboard macro for each line in the region. *Note Macros and Registers::, for more info. `[' Show contents of textmarker. `]' Show contents of register. File: viper, Node: Shell Commands, Next: Options, Prev: Mapping, Up: Commands Shell Commands ============== Note that % is used in Ex commands to mean current file. If you want a % in your command, it must be escaped as `\%'. However if % is the first character, it stands as the address for the whole file. Similarly, `#' expands to the previous file. The previous file is the first file in `:args' listing. This defaults to the previous file in the VI sense if you have one window. `:sh' Execute a subshell in another window `:[x,y]!' Execute a shell [on lines x through y; % is replace by current file, \% is changed to % `:[x,y]!! []' Repeat last shell command [and append ]. `:!' Just execute command and display result in a buffer. `:!! ' Repeat last shell command and append ` !' The shell executes , with standard input the lines described by , next the standard output replaces those lines (think of `cb', `sort', `nroff', etc.). ` !!' Give lines as standard input to the shell , next let the standard output replace those lines. `:[x,y] w !' Let lines x to y be standard input for (notice the between `w' and `!'). `:
r !' Put the output of after the line
(default current). `:
r ' Read the file into the buffer after the line
(default current). File: viper, Node: Options, Next: Emacs Related Commands, Prev: Shell Commands, Up: Commands Options ======= autoindent - In append mode after a the cursor will move directly below the first CHAR on the previous line. ignorecase - No distinction between upper and lower cases when searching. `magic' Regular expressions used in searches; nomagic means no regexps. readonly - The file is not to be changed. If the user attempts to write to this file, confirmation will be requested. `sh=' shell - The program to be used for shell escapes (default `$SHELL' (default `/bin/sh')). `sw=' shiftwidth - Gives the shiftwidth (default 8 positions). showmatch - Whenever you append a `)', Vi shows its match if it's on the same page; also with `{' and `}'. If there's no match, Vi will beep. `ts=' tabstop - The length of a ; warning: this is only IN the editor, outside of it s have their normal length (default 8 positions). `wm=' wrapmargin - In append mode Vi automatically puts a whenever there is a or within columns from the right margin. wrapscan - When searching, the end is considered `stuck' to the begin of the file. `:set